#!/usr/bin/env python
#! -*- coding: utf-8 -*-

import datetime

from logic.statistics import DataQuery

if __name__ == '__main__':
    days = datetime.timedelta(days=1)
    now_day = datetime.datetime.now()
    yesterday = now_day - days
    print '各位老师，这是昨日（%s月%s日）审方统计：' % (yesterday.month, yesterday.day)

    prescription_data = DataQuery.get_countofprescription()
    print '处方：','审方总数--',prescription_data["total"],'；','引擎自动通过--',prescription_data["auto"],'；',\
        '夜间自通--',prescription_data["night_auto"],'；','需要人工审核的数量--',prescription_data["need_manual"]

    order_data = DataQuery.get_countoforder()
    print '医嘱：','审方总数--',order_data["total"],'；','引擎自动通过--',order_data["auto"],'；',\
        '夜间自通--',order_data["night_auto"],'；','需要人工审核的数量--',order_data["need_manual"]
